package store

import (
	"context"
	"ota/model"
	"ota/model/entity"
)

type IUserUpgrade interface {
	// Create
	Create(ctx context.Context, e *entity.UserUpgrade) (int64, error)

	// Create In Batch
	CreateInBatch(ctx context.Context, e []*entity.UserUpgrade, size int) error

	// Find
	Find(ctx context.Context, in *model.UserUpgradeInfoRequest) (*entity.UserUpgrade, error)
	// Update
	Update(ctx context.Context, id int64, updates map[string]interface{}) error

	Updates(ctx context.Context, id []int64, updates map[string]interface{}) error

	UpdateByPlanId(ctx context.Context, id int64, updates map[string]interface{}) error

	// Delete
	Delete(ctx context.Context, id int64) error

	// DeleteByPlanId
	DeleteByPlanId(ctx context.Context, planId int64) error

	// List
	List(ctx context.Context, in *model.UserUpgradeListRequest, opts ...model.QueryOptions) (int, []*entity.UserUpgrade, error)

	// Statistics
	Statistics(ctx context.Context, in *model.UserUpgradeStatisticsRequest) (*model.UserUpgradeStatisticsResponse, error)

	// ExecTransaction
	ExecTransaction(ctx context.Context, callback func(ctx context.Context) error) error
}
